import Vue from 'vue'
import Router from 'vue-router'
const home = resolve => require(['@/components/home'], resolve);
const noticeList = resolve => require(['@/components/notice/noticeList'], resolve);
const noticeDetail = resolve => require(['@/components/notice/noticeDetail'], resolve);
const me = resolve => require(['@/components/mycenter/me'], resolve);
const myVoteList = resolve => require(['@/components/mycenter/myVoteList'], resolve);
const myApply = resolve => require(['@/components/mycenter/myApply'], resolve);
const myVoteDetail = resolve => require(['@/components/mycenter/myVoteDetail'], resolve);
const myVoteValidate = resolve => require(['@/components/mycenter/myVoteValidate'], resolve);
const validateResult = resolve => require(['@/components/mycenter/validateResult'], resolve);
const login = resolve => require(['@/components/login/login'], resolve);
const register = resolve => require(['@/components/login/register'], resolve);
const forget = resolve => require(['@/components/login/forget'], resolve);
const setting = resolve => require(['@/components/mycenter/setting'], resolve);
const voteDetail = resolve => require(['@/components/vote/voteDetail'], resolve);
const voteDetailEasy = resolve => require(['@/components/vote/voteDetailEasy'], resolve);
const voteApply = resolve => require(['@/components/vote/voteApply'], resolve);
const changePassword = resolve => require(['@/components/mycenter/changePassword'], resolve);
const voteResult = resolve => require(['@/components/vote/voteResult'], resolve);
const check = resolve => require(['@/components/vote/check'], resolve);
const voteRank = resolve => require(['@/components/vote/voteRank'], resolve);
const voteBrief = resolve => require(['@/components/vote/voteBrief'], resolve);
const optionDetail = resolve => require(['@/components/vote/optionDetail'], resolve);
const myVoteRecordList = resolve => require(['@/components/vote/myVoteRecordList'], resolve);
const echain = resolve => require(['@/components/echain/echain'], resolve);

const voteResultList = resolve => require(['@/components/vote/voteResultList'], resolve);

Vue.use(Router)

export default new Router({
  mode: 'history',
  base:'/wechat',
  routes: [
    {
      path: '/',
      name: 'home',
      meta: {
        title: '首页'
      },
      component: home
    },
    {
      path: '/noticeList',
      name: 'noticeList',
      meta: {
        title: '公告'
      },
      component: noticeList
    },
    {
      path: '/noticeDetail',
      name: 'noticeDetail',
      meta: {
        title: '公告详情'
      },
      component: noticeDetail
    },
    {
      path: '/me',
      name: 'me',
      meta: {
        title: '我的'
      },
      component: me
    },
    {
      path: '/myVoteList',
      name: 'myVoteList',
      meta: {
        title: '我参与的投票'
      },
      component: myVoteList
    },
    {
      path: '/myApply',
      name: 'myApply',
      meta: {
        title: '我的申请'
      },
      component: myApply
    },
    {
      path: '/myVoteDetail',
      name: 'myVoteDetail',
      meta: {
        title: '投票明细'
      },
      component: myVoteDetail
    },
    {
      path: '/myVoteValidate',
      name: 'myVoteValidate',
      meta: {
        title: '投票验证'
      },
      component: myVoteValidate
    },
    {
      path: '/validateResult',
      name: 'validateResult',
      meta: {
        title: '验证结果'
      },
      component: validateResult
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        title: '登录'
      },
      component: login
    },
    {
      path: '/register',
      name: 'register',
      meta: {
        title: '注册'
      },
      component: register
    },
    {
      path: '/forget',
      name: 'forget',
      meta: {
        title: '忘记密码'
      },
      component: forget
    },
    {
      path: '/voteDetail',
      name: 'voteDetail',
      meta: {
        title: '投票详情'
      },
      component: voteDetail
    },
    {
      path: '/voteDetailEasy',
      name: 'voteDetailEasy',
      meta: {
        title: '投票详情'
      },
      component: voteDetailEasy
    },
    {
      path: '/voteApply',
      name: 'voteApply',
      meta: {
        title: '申请权限'
      },
      component: voteApply
    },
    {
      path: '/setting',
      name: 'setting',
      meta: {
        title: '设置'
      },
      component: setting
    },
    {
      path: '/changePassword',
      name: 'changePassword',
      meta: {
        title: '修改密码'
      },
      component: changePassword
    },
    {
      path: '/voteResult',
      name: 'voteResult',
      meta: {
        title: '投票结果'
      },
      component: voteResult
    },
    {
      path: '/check',
      name: 'check',
      meta: {
        title: '提交成功'
      },
      component: check
    },
    {
      path: '/voteRank',
      name: 'voteRank',
      meta: {
        title: '当前排名'
      },
      component: voteRank
    },
    {
      path: '/voteBrief',
      name: 'voteBrief',
      meta: {
        title: '活动介绍'
      },
      component: voteBrief
    },
    {
      path: '/optionDetail',
      name: 'optionDetail',
      meta: {
        title: '选项详情'
      },
      component: optionDetail
    },
    {
      path: '/voteResultList',
      name: 'voteResultList',
      meta: {
        title: '查询列表'
      },
      component: voteResultList
    },
    {
      path: '/echain',
      name: 'echain',
      meta: {
        title: '区块'
      },
      component: echain
    },
    {
      path: '/myVoteRecordList',
      name: 'myVoteRecordList',
      meta: {
        title: '投票记录'
      },
      component: myVoteRecordList
    },

  ]
})
